import Request from './request.js'
const request = new Request();


// export const baseUrl = 'http://ls.ngrok2.xiaomiqiu.cn'



/**
 *   首页轮播图
 */
export const lookBanner = async (data)=>{
    const res = await request.get(`/app/list/lookBanner`,data,true)
    return res
}

/**
 *   查看所有餐厅
 */
export const lookRestaurant = async (data)=>{
    const res = await request.get(`/app/list/lookRestaurant`,data,true)
    return res
}

/**
 * 按照餐厅或者不按 查看所有菜单所有分类
 * */
 
 export const lookMenuClassification = async (data)=>{
     const res = await request.get(`/app/list/lookMenuClassification`,data,true)
     return res
 }

/**
 * 按照分类以及条件分页查看所有商品
 * */
 
 export const lookGoods = async (data)=>{
     const res = await request.post(`/app/list/lookGoods`,data,true,true)
     return res
 }
 
 /**
  * 登录
  * */
  
  export const userLogin = async (data)=>{
      const res = await request.post(`/app/user/userLogin`,data,false,true)
      return res
  }
  
 /**
  * 注册
  * */
  
  export const userRegister = async (data)=>{
      const res = await request.post(`/app/user/userRegister`,data,true,true)
      return res
  }
  
 /**
  * 退出登录
  * */
  
  export const logout = async (data)=>{
      const res = await request.getlogout(`/app/user/logout`,data,true)
      return res
  }
  
  
  /**
   * 修改用户信息
   * */
   
   export const updateUserInfo = async (data,token)=>{
       const res = await request.posttoken(`/app/updateUserInfo`,data,token,true,true)
       return res
   }
   
/**
   * 上传图片
   * */
   
   export const uploadFiles = async (data,token)=>{
	   console.log(token)
       const res = await request.uploadImage(`/app/uploadFile`,data,token,true,true)
       return res
   }
  
  /**
   * 获取收货地址
   * */
   
   export const lookAddress = async (data,token)=>{
	   console.log('123',data,token)
       const res = await request.getlogout(`/app/lookAddress`,data,token,true)
       return res
   }
   
/**
   * 查询订单列表
   * */
   
   export const lookOrder = async (data,token)=>{
       const res = await request.gettoken(`/app/order/lookOrder`,data,token,true)
       return res
   }
   
/**
   * 查询订单详情
   * */
   
   export const lookOrderDetail = async (data,token)=>{
	   console.log('123',data,token)
       const res = await request.gettoken(`/app/order/lookOrderDetail`,data,token,true)
       return res
   }   
   
/**
   * 获取用户信息
   * */
   
   export const getUserInfo = async (data,token)=>{
       const res = await request.gettoken(`/app/getUserInfo`,data,token,true)
       return res
   }  



/**
    * 查看系统公告
    * */
    
    export const lookNotices = async (data,token)=>{
        const res = await request.posttokenquery(`/app/lookNotices`,data,token,true,true)
        return res
    }   
	
/**
    * 公告已读
    * */
    
    export const updateNotice = async (data,token)=>{
        const res = await request.posttokenquery(`/app/updateNotice`,data,token,true,true)
        return res
    }  

/**
    * 删除公告
    * */
    
    export const delNotice = async (data,token)=>{
        const res = await request.posttokenquery(`/app/delNotice`,data,token,true,true)
        return res
    } 
   
   /**
    * 添加收货地址
    * */
    
    export const addAddress = async (data,token)=>{
        const res = await request.posttoken(`/app/addAddress`,data,token,true,true)
        return res
    }
	
	
  /**
    * 用户下单
    * */
    
    export const addOrder = async (data,token)=>{
        const res = await request.posttoken(`/app/order/addOrder`,data,token,true,true)
        return res
    }	

  /**
    * 支付订单
    * */
    
    export const payOrder = async (data,token)=>{
        const res = await request.posttoken(`/app/order/payOrder`,data,token,true,true)
        return res
    }	

	
	